package com.xinqing.bigdata.flink.util;

import org.apache.kafka.clients.producer.Partitioner;
import org.apache.kafka.common.Cluster;

import java.util.Map;

/**
 * @Author:CHQ
 * @Date:2021/5/12 19:12
 * @Description
 */
public class KafkaMsgProductWithPartition implements Partitioner{

    public static void main(String args[]) {

    }

    @Override
    public int partition(String topic, Object key, byte[] keyBytes, Object value, byte[] valueBytes, Cluster cluster) {
        //指定数据写入0号分区
        return 0;
    }

    @Override
    public void close() {

    }

    @Override
    public void configure(Map<String, ?> configs) {

    }
}
